<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: QUANYUNA
  Date: 2021/5/11
  Time: 10:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    //获取项目的根路径
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <title>书籍查询页面</title>
<%--    <link rel="stylesheet" href="<%=basePath%>/gq/jsp/css/donateBook.css">--%>
    <style type="text/css">
        * {
            margin: auto;
            padding: 0px;
        }





        tr{
            font-size: 20px;
        }

        input{
            font-size: 20px;
        }

        select{
            width: 244px;
            font-size: 20px;
        }

        input[name='time']{
            width: 244px;
        }

        #book_table tr{
            width: 80px;
            height: 10px;
        }

        h2{
            color: red;
        }

        input[name='button_two_td']{
            position: absolute;
            left: -120px;
            top: 32px;
        }




        .p_select{
            font-size: 30px;
            /*margin-top: 180px;*/
            text-align: center;
        }

        #id_select{
            font-size: 30px;
            background: #1E9FFF;
        }




    </style>
    <link rel="stylesheet" href="<%=basePath%>/sweetalert.css">
    <link rel="stylesheet" href="<%=basePath%>/layui-v2.6.6/css/layui.css">
</head>

<body id="body_select">
    <form action="<%=basePath%>/InsertServlet?tp=select" method="post">
        <p class="p_select"><input type="text"placeholder="全部" name="name_select">
        <input type="submit" name="submit_select"value="查询"></p>
    </form>
    <table class="layui-table" lay-even="" lay-skin="nob" border="2px">
        <colgroup>
            <col width="150">
            <col width="150">
            <col width="200">
            <col>
        </colgroup>
        <thead>
        <tr>
                <td>书籍编码</td>
                <td>捐书人</td>
                <td>书名</td>
                <td>作者</td>
                <td>类型编码</td>
                <td>数量</td>
                <td>金额</td>
                <td>捐赠日期</td>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${page.list}" var="list" >
            <tr id="page_tbody">
                <td id="td_delete">${list.getNo()}</td>
                <td>${list.getName()}</td>
                <td>${list.getBookName()}</td>
                <td>${list.getAuthor()}</td>
                <td>${list.getType()}</td>
                <td>${list.getSum()}</td>
                <td>${list.getMoney()}</td>
                <td>${list.getTime()}</td>
            </tr>
        </c:forEach>
        <td colspan="10" align="center" id="id_select">
            <a href="<%=basePath%>InsertServlet?currentPage=1&tp=select">首页</a>
            <a href="<%=basePath%>InsertServlet?currentPage=${requestScope.page.currentPage-1}&tp=select">上一页</a>
            <a href="<%=basePath%>InsertServlet?currentPage=${requestScope.page.currentPage+1}&tp=select">下一页</a>
            <a href="<%=basePath%>InsertServlet?currentPage=${requestScope.page.totalPage}&tp=select">末页</a>
        </td>
        </tbody>
    </table>
    </table>
<script src="<%=basePath%>/jquery-1.12.4.js"></script>
<script type="text/javascript">
    $(document).ready(function () {

        //点击进行修改功能的js
        $(".update").click(function () {
            let list = $(this).parent().children();
            $("#idd").val(list.text()[0]);
            // $("#goods_Name").val(list.text()[1]);
            // alert(list.text()[0]);
            //  alert(list.text()[1]);
            $("#update_div").show();
        });
        //点击进行修改页面的隐藏
        $("#exit").click(function () {
            $("#update_div").hide();
        });
    })
</script>
</body>


</html>
